// 仪器相关常量定义
import { 
  InstrumentStatus, 
  FeeMethod, 
  TrainFeeMethod, 
  RoleType, 
  OrderType, 
  DateType,
  IsRequired,
  Status,
  IsWorkday,
  Weekday
} from '@/types/instrument';

// 仪器状态映射
export const INSTRUMENT_STATUS_MAP = {
  [InstrumentStatus.ONLINE]: '已上线',
  [InstrumentStatus.OFFLINE]: '已下线',
  [InstrumentStatus.MAINTENANCE]: '维护中',
};

// 仪器状态标签样式
export const INSTRUMENT_STATUS_TAG_COLOR = {
  [InstrumentStatus.ONLINE]: 'success',
  [InstrumentStatus.OFFLINE]: 'default',
  [InstrumentStatus.MAINTENANCE]: 'warning',
};

// 收费方式映射
export const FEE_METHOD_MAP = {
  [FeeMethod.BY_HOUR]: '按机时',
  [FeeMethod.BY_SAMPLE]: '按样品',
};

// 培训收费方式映射
export const TRAIN_FEE_METHOD_MAP = {
  [TrainFeeMethod.BY_HOUR]: '按机时',
  [TrainFeeMethod.BY_TIME]: '按次数',
};

// 角色类型映射
export const ROLE_TYPE_MAP = {
  [RoleType.SUPER_ADMIN]: '超级管理员',
  [RoleType.ADMIN]: '管理员',
  [RoleType.INSTRUMENT_MANAGER]: '仪器负责人',
  [RoleType.INSTRUMENT_OPERATOR]: '仪器操作员',
  [RoleType.FINANCE]: '财务',
  [RoleType.LEVEL_1_USER]: '1级用户',
  [RoleType.LEVEL_2_USER]: '2级用户',
  [RoleType.LEVEL_3_USER]: '3级用户',
};

// 订单类型映射
export const ORDER_TYPE_MAP = {
  [OrderType.SAMPLE_DELIVERY]: '送样申请',
  [OrderType.ENGINEER_OPERATION]: '仪器预约-工程师操作',
  [OrderType.SELF_OPERATION]: '仪器预约-自主操作',
};

// 日期类型映射
export const DATE_TYPE_MAP = {
  [DateType.CLOSE_ALL_DAY]: '关闭整天',
  [DateType.CUSTOM_TIME_SLOTS]: '自定义时间段',
};

// 是否必选映射
export const IS_REQUIRED_MAP = {
  [IsRequired.NO]: '否',
  [IsRequired.YES]: '是',
};

// 状态映射
export const STATUS_MAP = {
  [Status.NORMAL]: '正常',
  [Status.DISABLED]: '禁用',
};

// 是否工作日映射
export const IS_WORKDAY_MAP = {
  [IsWorkday.NO]: '否',
  [IsWorkday.YES]: '是',
};

// 星期映射
export const WEEKDAY_MAP = {
  [Weekday.MONDAY]: '周一',
  [Weekday.TUESDAY]: '周二',
  [Weekday.WEDNESDAY]: '周三',
  [Weekday.THURSDAY]: '周四',
  [Weekday.FRIDAY]: '周五',
  [Weekday.SATURDAY]: '周六',
  [Weekday.SUNDAY]: '周日',
};

// 订单类型选项
export const ORDER_TYPE_OPTIONS = [
  { label: '送样申请', value: OrderType.SAMPLE_DELIVERY },
  { label: '仪器预约-工程师操作', value: OrderType.ENGINEER_OPERATION },
  { label: '仪器预约-自主操作', value: OrderType.SELF_OPERATION },
];

// 仪器状态选项
export const INSTRUMENT_STATUS_OPTIONS = [
  { label: '已上线', value: InstrumentStatus.ONLINE },
  { label: '已下线', value: InstrumentStatus.OFFLINE },
  { label: '维护中', value: InstrumentStatus.MAINTENANCE },
];

// 收费方式选项
export const FEE_METHOD_OPTIONS = [
  { label: '按机时', value: FeeMethod.BY_HOUR },
  { label: '按样品', value: FeeMethod.BY_SAMPLE },
];

// 培训收费方式选项
export const TRAIN_FEE_METHOD_OPTIONS = [
  { label: '按机时', value: TrainFeeMethod.BY_HOUR },
  { label: '按次数', value: TrainFeeMethod.BY_TIME },
];

// 角色类型选项
export const ROLE_TYPE_OPTIONS = [
  { label: '1级用户', value: RoleType.LEVEL_1_USER },
  { label: '2级用户', value: RoleType.LEVEL_2_USER },
  { label: '3级用户', value: RoleType.LEVEL_3_USER },
];

// 日期类型选项
export const DATE_TYPE_OPTIONS = [
  { label: '关闭整天', value: DateType.CLOSE_ALL_DAY },
  { label: '自定义时间段', value: DateType.CUSTOM_TIME_SLOTS },
];

// 是否必选选项
export const IS_REQUIRED_OPTIONS = [
  { label: '否', value: IsRequired.NO },
  { label: '是', value: IsRequired.YES },
];

// 状态选项
export const STATUS_OPTIONS = [
  { label: '正常', value: Status.NORMAL },
  { label: '禁用', value: Status.DISABLED },
];

// 是否工作日选项
export const IS_WORKDAY_OPTIONS = [
  { label: '否（自定义星期）', value: IsWorkday.NO },
  { label: '是（法定工作日）', value: IsWorkday.YES },
];

// 星期选项
export const WEEKDAY_OPTIONS = [
  { label: '周一', value: Weekday.MONDAY },
  { label: '周二', value: Weekday.TUESDAY },
  { label: '周三', value: Weekday.WEDNESDAY },
  { label: '周四', value: Weekday.THURSDAY },
  { label: '周五', value: Weekday.FRIDAY },
  { label: '周六', value: Weekday.SATURDAY },
  { label: '周日', value: Weekday.SUNDAY },
];

// 默认时间段
export const DEFAULT_TIME_SLOTS = [
  { startTime: '09:00:00', endTime: '12:00:00' },
  { startTime: '13:00:00', endTime: '17:00:00' },
];

// 全天时间段
export const ALL_DAY_TIME_SLOT = { startTime: '09:00:00', endTime: '23:59:59' };

// 工作日
export const WORKDAYS = [Weekday.MONDAY, Weekday.TUESDAY, Weekday.WEDNESDAY, Weekday.THURSDAY, Weekday.FRIDAY];

// 周末
export const WEEKENDS = [Weekday.SATURDAY, Weekday.SUNDAY];

// 全周
export const ALL_WEEK = [Weekday.MONDAY, Weekday.TUESDAY, Weekday.WEDNESDAY, Weekday.THURSDAY, Weekday.FRIDAY, Weekday.SATURDAY, Weekday.SUNDAY]; 



